package com.example.electricpower.controller;

import entity.Order;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/Order")
public class OrderController {
    @GetMapping("/cxOrder")
    public String query(String name,String number,String subprice,String cost){
        System.out.println("订单编号为："+number);
        return "通过该订单编号，我们查询出了该订单商品名为"+name+"这个商品价格为"+subprice+"实付金额为"+cost;

    }
    @PostMapping("/subpost")
    public  String select(@RequestBody Order order){
        System.out.println(order.getSubnum());
        System.out.println(order.getSubaddress());
        System.out.println(order.getSubprice());
        return  "该条信息已插入数据库，订单编号为："+order.getSubnum();
    }





    @GetMapping("/selectOrder")
    public String getOrder(String subOrder,Integer num,String type){
        System.out.println("订单编号为："+subOrder);
        return type+"类型的商品，库存减少了"+num;
    }

}


